Integrand size = 22, antiderivative size = 255 \[ \int \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx=-\frac {2 i b^2 x}{d}+\frac {2}{3} a^2 x^{3/2}-\frac {8 i a b x \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {4 b^2 \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {2 i b^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {8 a b \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {8 a b \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {2 b^2 x \tan \left (c+d \sqrt {x}\right )}{d} \]
[Out]
Time = 0.41 (sec) , antiderivative size = 255, normalized size of antiderivative = 1.00, number of steps used = 15, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {4289, 4275, 4266, 2611, 2320, 6724, 4269, 3800, 2221, 2317, 2438} \[ \int \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx=\frac {2}{3} a^2 x^{3/2}-\frac {8 i a b x \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {8 a b \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {8 a b \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {2 i b^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {4 b^2 \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {2 b^2 x \tan \left (c+d \sqrt {x}\right )}{d}-\frac {2 i b^2 x}{d} \]
[In]
[Out]
Rule 2221
Rule 2317
Rule 2320
Rule 2438
Rule 2611
Rule 3800
Rule 4266
Rule 4269
Rule 4275
Rule 4289
Rule 6724
Rubi steps \begin{align*} \text {integral}& = 2 \text {Subst}\left (\int x^2 (a+b \sec (c+d x))^2 \, dx,x,\sqrt {x}\right ) \\ & = 2 \text {Subst}\left (\int \left (a^2 x^2+2 a b x^2 \sec (c+d x)+b^2 x^2 \sec ^2(c+d x)\right ) \, dx,x,\sqrt {x}\right ) \\ & = \frac {2}{3} a^2 x^{3/2}+(4 a b) \text {Subst}\left (\int x^2 \sec (c+d x) \, dx,x,\sqrt {x}\right )+\left (2 b^2\right ) \text {Subst}\left (\int x^2 \sec ^2(c+d x) \, dx,x,\sqrt {x}\right ) \\ & = \frac {2}{3} a^2 x^{3/2}-\frac {8 i a b x \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {2 b^2 x \tan \left (c+d \sqrt {x}\right )}{d}-\frac {(8 a b) \text {Subst}\left (\int x \log \left (1-i e^{i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d}+\frac {(8 a b) \text {Subst}\left (\int x \log \left (1+i e^{i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d}-\frac {\left (4 b^2\right ) \text {Subst}\left (\int x \tan (c+d x) \, dx,x,\sqrt {x}\right )}{d} \\ & = -\frac {2 i b^2 x}{d}+\frac {2}{3} a^2 x^{3/2}-\frac {8 i a b x \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {2 b^2 x \tan \left (c+d \sqrt {x}\right )}{d}-\frac {(8 i a b) \text {Subst}\left (\int \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^2}+\frac {(8 i a b) \text {Subst}\left (\int \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^2}+\frac {\left (8 i b^2\right ) \text {Subst}\left (\int \frac {e^{2 i (c+d x)} x}{1+e^{2 i (c+d x)}} \, dx,x,\sqrt {x}\right )}{d} \\ & = -\frac {2 i b^2 x}{d}+\frac {2}{3} a^2 x^{3/2}-\frac {8 i a b x \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {4 b^2 \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {2 b^2 x \tan \left (c+d \sqrt {x}\right )}{d}-\frac {(8 a b) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-i x)}{x} \, dx,x,e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {(8 a b) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,i x)}{x} \, dx,x,e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {\left (4 b^2\right ) \text {Subst}\left (\int \log \left (1+e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^2} \\ & = -\frac {2 i b^2 x}{d}+\frac {2}{3} a^2 x^{3/2}-\frac {8 i a b x \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {4 b^2 \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {8 a b \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {8 a b \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {2 b^2 x \tan \left (c+d \sqrt {x}\right )}{d}+\frac {\left (2 i b^2\right ) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3} \\ & = -\frac {2 i b^2 x}{d}+\frac {2}{3} a^2 x^{3/2}-\frac {8 i a b x \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {4 b^2 \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {2 i b^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {8 a b \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {8 a b \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {2 b^2 x \tan \left (c+d \sqrt {x}\right )}{d} \\ \end{align*}
Time = 0.77 (sec) , antiderivative size = 247, normalized size of antiderivative = 0.97 \[ \int \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx=\frac {2 \left (-3 i b^2 d^2 x+a^2 d^3 x^{3/2}-12 i a b d^2 x \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )+6 b^2 d \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )+12 i a b d \sqrt {x} \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )-12 i a b d \sqrt {x} \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )-3 i b^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )-12 a b \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )+12 a b \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )+3 b^2 d^2 x \tan \left (c+d \sqrt {x}\right )\right )}{3 d^3} \]
[In]
[Out]
\[\int \left (a +b \sec \left (c +d \sqrt {x}\right )\right )^{2} \sqrt {x}d x\]
[In]
[Out]
\[ \int \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx=\int { {\left (b \sec \left (d \sqrt {x} + c\right ) + a\right )}^{2} \sqrt {x} \,d x } \]
[In]
[Out]
\[ \int \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx=\int \sqrt {x} \left (a + b \sec {\left (c + d \sqrt {x} \right )}\right )^{2}\, dx \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1272 vs. \(2 (194) = 388\).
Time = 0.45 (sec) , antiderivative size = 1272, normalized size of antiderivative = 4.99 \[ \int \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx=\int { {\left (b \sec \left (d \sqrt {x} + c\right ) + a\right )}^{2} \sqrt {x} \,d x } \]
[In]
[Out]
Timed out. \[ \int \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx=\int \sqrt {x}\,{\left (a+\frac {b}{\cos \left (c+d\,\sqrt {x}\right )}\right )}^2 \,d x \]
[In]
[Out]